<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编译作用域</title>
</head>
<body>
    <div id="app">
        <cpn v-show="isShow"></cpn>
    </div>

    <template id="cpn">
        <div>
            <h2>子组件</h2>
        </div>
    </template>

    <script src="../js/vue.js"></script>
    <script>
        const cpn = {
            template: '#cpn',
            data() {
                return {
                    isShow: false
                }
            }
        }

        const app = new Vue({
            el: '#app',
            data: {
                message: 'Demo',
                isShow: true
            },
            methods: {

            },
            components: {
                cpn
            }
        })
    </script>
</body>
</html>